<?php
return array(
    'runHandlers'=>array(
        '@' => array(
            'handler'=>'RedirectOnDataHandler',
            'params'=>array(
                'onFalse'=>'@authUser',
                'url'=>'/login/'
            ),
        ),
        'userCanModify' => array(
            'handler'=>'user/CheckUserRoles',
            'params'=>array(
                'user'=>'@authUser',
                'requiredRoles'=>array(1), //Директор
            ),
        ),
        '@1' => array(
            'handler'=>'RedirectOnDataHandler',
            'params'=>array(
                'onFalse'=>'@userCanModify',
                'url'=>'/not-enough-rules'
            ),
        ),
        'taskCategoryEdit' => array(
            'handler'=>'task/TaskCategoryEditHandler',
            'params'=>array(
              'companyObj'=>'@userCompany',
              'action'=>$_POST['action'],
              'uuid'=>$_POST['uuid'],
              'name'=>$_POST['name'],
              'label'=>$_POST['label'],
              'price'=>$_POST['price'],
              'report'=>$_POST['report'],
            ),
        ),
        'taskCategoryShow' => array(
            'handler'=>'task/TaskCategoryShowHandler',
            'params'=>array(
              'companyObj'=>'@userCompany',
            ),
        ),
    ),
);    